package shiyanbaogao6;


import java.util.List;

public class ViewMain {
    public static void main(String[] args) {
        EmployeeManager manager = new EmployeeManager();
        String filePath = "employees.txt";

        // 1. 创建三个员工对象
        Employee emp1 = new Employee("张三", 30, 5000.0);
        Employee emp2 = new Employee("李四", 25, 6000.0);
        Employee emp3 = new Employee("王五", 35, 7000.0);

        // 2. 把全部的员工信息添加到文件中
        manager.addEmployeeToFile(emp1, filePath);
        manager.addEmployeeToFile(emp2, filePath);
        manager.addEmployeeToFile(emp3, filePath);

        // 3. 获取文件中的全部员工信息，打印控制台
        List<Employee> allEmployees = manager.readEmployeesFromFile(filePath);
        manager.printEmployees(allEmployees);
    }
}


